package com.wswy.wzcx.ui.data

import android.os.Parcelable
import com.google.gson.annotations.SerializedName
import com.wswy.wzcx.R
import kotlinx.android.parcel.Parcelize

/**
 * Created by wangduheng26 on 2018/4/11.
 * wangduheng26@gmail.com
 */
@Parcelize
class WZDBMode(@SerializedName("agencyFee") val agencyFee: Double?,
               @SerializedName("chePaiHaoMa") val chePaiHaoMa: String?,
               @SerializedName("daiBanFei") val daiBanFei: Double?,
               @SerializedName("deductPoint") val deductPoint: Int?,
               @SerializedName("faKuanJinHe") val faKuanJinHe: Double?,
               @SerializedName("nopass") val nopass: Boolean?,
               @SerializedName("status") val status: Int?,
               @SerializedName("orderState")
               val orderState: String?,
               @SerializedName("overdueFine")
               val overdueFine: Double?,
               @SerializedName("pinZhenHao")
               val pinZhenHao: String?,
               @SerializedName("weiFaDiZhi")
               val weiFaDiZhi: String?,
               @SerializedName("weiFaSheJiang")
               val weiFaSheJiang: String?,
               @SerializedName("weiFaXinWeiMingCheng")
               val weiFaXinWeiMingCheng: String?,
               @SerializedName("uniqueMd5Id")
               val uniquerMd5Id: String?) : Parcelable {
    fun checkDJ(): Boolean {
        return status == 10
    }

    fun getTip(): String =
            when (status) {
                10 -> "可代缴"
                20 -> "交管局不支持代缴"
                30 -> "正在办理中"
                else -> "未知原因"
            }

    fun getTipColor(): Int =
            when (status) {
                20 -> R.color.textSevereColor
                else -> R.color.colorAccent
            }
}